home *** CD-ROM | disk | FTP | other *** search
/ Internet Surfer 2.0 / Internet Surfer 2.0 (Wayzata Technology) (1996).iso / pc / textfile / faqs / lisp_faq / part2 < prev    next >
Encoding:
Internet Message Format  |  1992-12-26  |  28.2 KB

  1. Xref: bloom-picayune.mit.edu comp.lang.lisp:8750 news.answers:4560
  2. Path: bloom-picayune.mit.edu!enterpoop.mit.edu!spool.mu.edu!uunet!ogicse!das-news.harvard.edu!cantaloupe.srv.cs.cmu.edu!crabapple.srv.cs.cmu.edu!mkant
  3. From: mkant+@cs.cmu.edu (Mark Kantrowitz)
  4. Newsgroups: comp.lang.lisp,news.answers
  5. Subject: FAQ: Lisp Frequently Asked Questions 2/6 [Monthly posting]
  6. Summary: Frequently asked questions about Lisp -- General Questions
  7. Message-ID: <lisp-faq-2.text_724237288@cs.cmu.edu>
  8. Date: 13 Dec 92 09:01:37 GMT
  9. Article-I.D.: cs.lisp-faq-2.text_724237288
  10. Expires: Tue, 26 Jan 1993 09:01:28 GMT
  11. Sender: news@cs.cmu.edu (Usenet News System)
  12. Reply-To: lisp-faq@think.com
  13. Followup-To: poster
  14. Organization: School of Computer Science, Carnegie Mellon
  15. Lines: 546
  16. Approved: news-answers-request@MIT.Edu
  17. Supersedes: <lisp-faq-2.text_721645310@cs.cmu.edu>
  18. Nntp-Posting-Host: a.gp.cs.cmu.edu
  19.  
  20. Archive-name: lisp-faq/part2
  21. Last-Modified: Thu Nov  5 19:30:40 1992 by Mark Kantrowitz
  22. Version: 1.27
  23.  
  24. ;;; ****************************************************************
  25. ;;; Answers to Frequently Asked Questions about Lisp ***************
  26. ;;; ****************************************************************
  27. ;;; Written by Mark Kantrowitz and Barry Margolin
  28. ;;; lisp-faq-2.text -- 28371 bytes
  29.  
  30. This post contains Part 2 of the Lisp FAQ.
  31.  
  32. If you think of questions that are appropriate for this FAQ, or would
  33. like to improve an answer, please send email to us at lisp-faq@think.com.
  34.  
  35. Topics Covered (Part 2):
  36.  
  37.   [2-1]   Is there a GNU-Emacs interface to Lisp?
  38.   [2-3]   What is the equivalent of EXPLODE and IMPLODE in Common Lisp?
  39.   [2-4]   Is Lisp inherently slower than more conventional languages such as C?
  40.   [2-5]   Why does Common Lisp have "#'"?
  41.   [2-6]   How do I call non-Lisp functions from Lisp?
  42.   [2-7]   Can I call Lisp functions from other languages?
  43.   [2-8]   I want to call a function in a package that might not exist at
  44.           compile time. How do I do this?  
  45.   [2-9]   What is CDR-coding?
  46.   [2-10]  What is garbage collection?
  47.   [2-11]  How do I save an executable image of my loaded Lisp system?
  48.           How do I run a Unix command in my Lisp?
  49.           How do I get the current directory name from within a Lisp program?
  50.   [2-12]  I'm porting some code from a Symbolics Lisp machine to some
  51.           other platform, and there are strange characters in the code.
  52.           What do they mean?  
  53.   [2-13]  History: Where did Lisp come from?
  54.   [2-14]  How do I find the argument list of a function?
  55.           How do I get the function name from a function object?
  56.   [2-15]  How can I have two Lisp processes communicate via unix sockets?
  57.  
  58. Search for [#] to get to question number # quickly.
  59.  
  60. ----------------------------------------------------------------
  61. [2-1] Is there a GNU-Emacs interface to Lisp?
  62.  
  63. ILISP is a powerful GNU-Emacs interface to many dialects of
  64. Lisp, including Lucid, Allegro, {A}KCL, IBCL, and CMU. Written by
  65. Chris McConnell <ccm+@cs.cmu.edu>. It is available by anonymous
  66. ftp from katmandu.mt.cs.cmu.edu [128.2.250.68] in the directory
  67. pub/ilisp as the file ilisp.tar.Z. If you start using it, send
  68. Chris mail, as he maintains a mailing list of users.
  69.  
  70. Franz Inc.'s GNU-Emacs/Lisp interface includes an online Common
  71. Lisp manual. It is available by license from Franz Inc. Contact
  72. info@franz.com for more information. There is also a mailing list, 
  73. lisp-emacs-forum-request@ucbarpa.berkeley.edu.
  74.  
  75. The cl-shell package provides a major mode (cl-shell-mode) for running
  76. Common Lisp (CL) as an Emacs subprocess.  It provides a general
  77. mechanism for communication between CL and Emacs which does not rely
  78. on extra processes, and should therefore be easily portable to any
  79. version of CL.  Features include direct (i.e., not through a temp file)
  80. evaluation and in-package compilation of forms from lisp-mode buffers,
  81. type-ahead and a history mechanism for the cl-shell buffer, and pop-up
  82. help facilities for the CL functions documentation, macroexpand and
  83. describe.  Extensions for Lucid Common Lisp provide pop-up arglists
  84. and source file editing.  Other extensions are provided to allow
  85. editing source files of CLOS or Flavors methods.  Cl-shell is
  86. available on the Lucid tape (in the goodies directory) or via
  87. anonymous ftp from whitechapel.media.mit.edu (18.85.0.125).
  88.  
  89. Lucid includes some other Emacs-Lisp interfaces in its goodies directory.
  90.  
  91. Harlequin's LispWorks includes an Emacs-Lisp interface.
  92.  
  93. Venue's Medley has an optional EMACS Interface.
  94.  
  95. GNU-Emacs itself is available by anonymous ftp from prep.ai.mit.edu.
  96.  
  97. ----------------------------------------------------------------
  98. [2-3] What is the equivalent of EXPLODE and IMPLODE in Common Lisp?
  99.  
  100. Hopefully, the only reason you need to do this is as part of trying to port
  101. some old MacLisp code to Common Lisp.  These functions predated the
  102. inclusion of strings as a first-class data type in Lisp; symbols were used
  103. as strings, and they ere EXPLODEd to allow the individual characters to be
  104. manipulated in a list.
  105.  
  106. Probably the best approximations of these are:
  107.  
  108.    (defun explode (object)
  109.      (loop for char across (prin1-to-string object)
  110.            collect (intern (string char))))
  111.  
  112.    (defun implode (list)
  113.      (read-from-string (coerce (mapcar #'character list) 'string)))
  114.  
  115. An alternate definition of EXPLODE which uses MAP instead of LOOP is:
  116.  
  117.    (defun explode (object)
  118.      (map 'list #'(lambda (char) 
  119.                     (intern (string char)))
  120.           (prin1-to-string object)))
  121.  
  122. The creation of N conses of garbage to process a string of N
  123. characters is a hideously inefficient way of doing the job.  Rewrite
  124. EXPLODE code with PRIN1-TO-STRING, or better STRING if the arguments
  125. are symbols without funny characters.  For IMPLODE, try to make its
  126. caller use strings and try to make the result usable as a string to
  127. avoid having to call INTERN or READ-FROM-STRING.
  128.  
  129. ----------------------------------------------------------------
  130. [2-4] Is Lisp inherently slower than more conventional languages such as C?
  131.  
  132. This is a tough question to answer, as I'm sure you expected.  In many
  133. cases, it appears to be.  Lisp does not require the programmer to specify
  134. the data type of variables, so generic arithmetic operators may have to
  135. perform type checking at runtime in order to determine how to proceed.
  136. However, Lisp code can also be denser (i.e.  there is more expressed in a
  137. single line) than many other languages: the Lisp expression (+ A B) is more
  138. powerful than the C expression A+B (the Lisp version supports bignums,
  139. rationals, and complex numbers, while the C version only supports
  140. limited-size integers and floating point); therefore, one may claim that it
  141. is reasonable that the Lisp version take longer than the C version (but
  142. don't expect everyone to accept this rationalization).  Solutions to this
  143. include hardware support (e.g. processors that support type tags in data,
  144. such as SPARC and Symbolics Lisp Machines), declarations, and specialized
  145. variants of functions (e.g. in MacLisp, + accepts and returns only fixnums,
  146. +$ accepts and returns only flonums, and PLUS is generic).
  147.  
  148. At one time, the MIT PDP-10 MacLisp compiler was compared to DEC's PDP-10
  149. Fortran compiler.  When appropriate declarations were supplied in the Lisp
  150. code, the performance of compiled Lisp arithmetic rivaled that of the
  151. Fortran code.  It would hardly be fair to compare Lisp without declarations
  152. to Fortran, since the Fortran compiler would have more information upon
  153. which it could base its optimizations.
  154.  
  155. Since Lisp is a good language for rapid prototyping, it is easy for a
  156. mediocre programmer (or even a good programmer, who isn't being careful) to
  157. generate a large amount of inefficient Lisp code. A good example is the use
  158. of APPEND to link successive lists together, instead of keeping a pointer
  159. to the tail of the list. Often a programmer can obtain significant
  160. speed increases by using a time/space profiler to identify the
  161. functions which waste time (often small functions which are called
  162. frequently) and rewriting those functions.
  163.      
  164. ----------------------------------------------------------------
  165. [2-5] Why does Common Lisp have "#'"?
  166.  
  167. #' is a macro-character which expands #'FOO to (FUNCTION FOO).  Symbols in
  168. Lisp have two bindings, one for values and one for functions, allowing them
  169. to represent both variables and functions, depending on context. #'FOO
  170. accesses FOO's lexical function binding in a context where the value
  171. interpretation would normally occur.  #' is also used to create lexical
  172. closures for lambda expressions. A lexical closure is a function which when
  173. invoked executes the body of the lambda-expression in the lexical
  174. environment within which the closure was created.  See pp. 115-117 of CLtL2
  175. for more details.
  176.  
  177. ----------------------------------------------------------------
  178. [2-6] How do I call non-Lisp functions from Lisp?
  179.  
  180. Most Lisp implementations for systems where Lisp is not the most common
  181. language provide a "foreign function" interface.  As of now there has been
  182. no significant standardization effort in this area.  They tend to be
  183. similar, but there are enough differences that it would be inappropriate to
  184. try to describe them all here.  In general, one uses an
  185. implementation-dependent macro that defines a Lisp function, but instead of
  186. supplying a body for the function, one supplies the name of a function written
  187. in another language; the argument list portion of the definition is
  188. generally augmented with the data types the foreign function expects and
  189. the data type of the foreign function's return value, and the Lisp
  190. interface function arranges to do any necessary conversions.  There is also
  191. generally a function to "load" an object file or library compiled in a
  192. foreign language, which dynamically links the functions in the file being
  193. loaded into the address space of the Lisp process, and connects the
  194. interface functions to the corresponding foreign functions.
  195.  
  196. If you need to do this, see the manual for your language implementation for
  197. full details.  In particular, be on the lookout for restrictions on the
  198. data types that may be passed.  You may also need to know details about the
  199. linkage conventions that are used on your system; for instance, many C
  200. implementations prepend an underscore onto the names of C functions when
  201. generating the assembler output (this allows them to use names without
  202. initial underscores internally as labels without worrying about conflicts),
  203. and the foreign function interface may require you to specify this form
  204. explicitly.
  205.  
  206. Franz Allegro Common Lisp's "Foreign Function Call Facility" is
  207. described in chapter 10 of the documentation. Calling Lisp Functions
  208. from C is treated in section 10.8.2. The foreign function interface in
  209. Macintosh Common Lisp is similar. The foreign function interface for
  210. KCL is described in chapter 10 of the KCL Report. The foreign function
  211. interfaces for Lucid on the Vax and Lucid on the Sun4 are
  212. incompatible. Lucid's interface is described in chapter 5 of the
  213. Advanced User's Guide.
  214.  
  215. ----------------------------------------------------------------
  216. [2-7] Can I call Lisp functions from other languages?
  217.  
  218. In implementations that provide a foreign function interface as described
  219. above, there is also usually a "callback" mechanism.  The programmer may
  220. associate a foreign language function name with a Lisp function.  When a
  221. foreign object file or library is loaded into the Lisp address space, it is
  222. linked with these callback functions.  As with foreign functions, the
  223. programmer must supply the argument and result data types so that Lisp may
  224. perform conversions at the interface. Note that in such foreign function
  225. interfaces Lisp is often left "in control" of things like memory
  226. allocation, I/O channels, and startup code (this is a major nuisance
  227. for lots of people).
  228.      
  229. ----------------------------------------------------------------
  230.  
  231. [2-8]  I want to call a function in a package that might not exist at
  232.        compile time. How do I do this?
  233.  
  234. Use (funcall (find-symbol "SYMBOL-NAME" :pkg-name) ...).
  235.  
  236. ----------------------------------------------------------------
  237. [2-9]  What is CDR-coding?
  238.  
  239. CDR-coding is a space-saving way to store lists in memory.  It is normally
  240. only used in Lisp implementations that run on processors that are
  241. specialized for Lisp, as it is difficult to implement efficiently
  242. in software.  In normal list structure, each element of the
  243. list is represented as a CONS cell, which is basically two pointers (the
  244. CAR and CDR); the CAR points to the element of the list, while the CDR
  245. points to the next CONS cell in the list or NIL.  CDR-coding takes
  246. advantage of the fact that most CDR cells point to another CONS, and
  247. further that the entire list is often allocated at once (e.g. by a call to
  248. LIST).  Instead of using two pointers to implement each CONS cell, the CAR
  249. cell contains a pointer and a two-bit "CDR code".  The CDR code may contain
  250. one of three values: CDR-NORMAL, CDR-NEXT, and CDR-NIL.  If the code is
  251. CDR-NORMAL, this cell is the first half of an ordinary CONS cell pair, and
  252. the next cell in memory contains the CDR pointer as described above.  If
  253. the CDR code is CDR-NEXT, the next cell in memory contains the next CAR
  254. cell; in other words, the CDR pointer is implicitly thisaddress+1, where
  255. thisaddress is the memory address of the CAR cell.  If the CDR code is
  256. CDR-NIL, then this cell is the last element of the list; the CDR pointer is
  257. implicitly a reference to the object NIL.  When a list is constructed
  258. incrementally using CONS, a chain of ordinary pairs is created; however,
  259. when a list is constructed in one step using LIST or MAKE-LIST, a block of
  260. memory can be allocated for all the CAR cells, and their CDR codes all set
  261. to CDR-NEXT (except the last, which is CDR-NIL), and the list will only
  262. take half as much storage (because all the CDR pointers are implicit).
  263.  
  264. If this were all there were to it, it would not be difficult to implement
  265. in software on ordinary processors; it would add a small amount of overhead
  266. to the CDR function, but the reduction in paging might make up for it.  The
  267. problem arises when a program uses RPLACD on a CONS cell that has a CDR
  268. code of CDR-NEXT or CDR-NIL.  Normally RPLACD simply stores into the CDR
  269. cell of a CONS, but in this case there is no CDR cell -- its contents are
  270. implicitly specified by the CDR code, and the word that would normally
  271. contain the CDR pointer contains the next CONS cell (in the CDR-NEXT case)
  272. to which other data structures may have pointers, or the first word of some
  273. other object (in the CDR-NIL case).  When CDR-coding is used, the
  274. implementation must also provide automatic "forwarding pointers"; an
  275. ordinary CONS cell is allocated, the CAR of the original cell is copied
  276. into its CAR, the value being RPLACD'ed is stored into its CDR, and the old
  277. CAR cell is replaced with a forwarding pointer to the new CONS cell.
  278. Whenever CAR or CDR is performed on a CONS, it must check whether the
  279. location contains a forwarding pointer.  This overhead on both CAR and CDR,
  280. coupled with the overhead on CDR to check for CDR codes, is generally
  281. enough that using CDR codes on conventional hardware is infeasible.
  282.  
  283. There is some evidence that CDR-coding doesn't really save very much
  284. memory, because most lists aren't constructed at once, or RPLACD is done on
  285. them enough that they don't stay contiguous.  At best this technique can
  286. save 50% of the space occupied by CONS cells. However, the savings probably
  287. depends to some extent upon the amount of support the implementation
  288. provides for creating CDR-coded lists.  For instance, many system functions
  289. on Symbolics Lisp Machines that operate on lists have a :LOCALIZE option;
  290. when :LOCALIZE T is specified, the list is first modified and then copied
  291. to a new, CDR-coded block, with all the old cells replaced with forwarding
  292. pointers.  The next time the garbage collector runs, all the forwarding
  293. pointers will be spliced out.  Thus, at a cost of a temporary increase in
  294. memory usage, overall memory usage is generally reduced because more lists
  295. may be CDR-coded. There may also be some benefit in improved paging
  296. performance due to increased locality as well (putting a list into
  297. CDR-coded form makes all the "cells" contiguous). Nevertheless, modern
  298. Lisps tend to use lists much less frequently, with a much heavier
  299. reliance upon code, strings, and vectors (structures).
  300.  
  301. ----------------------------------------------------------------
  302. [2-10] What is garbage collection?
  303.  
  304. Garbage Collection (GC) refers to the automatic storage allocation
  305. mechanisms present in many Lisps. There are several kinds of storage
  306. allocation algorithms, but most fall within two main classes:
  307.  
  308.    1. Stop and Copy. Systems which copy active objects from "old"
  309.       storage to "new" storage and then recycle the old storage.
  310.  
  311.    2. Mark and Sweep. Systems which link together storage
  312.       used by discarded objects. 
  313.  
  314. Generational scavenging garbage collection (aka emphemeral GC) is a
  315. variation in which memory is allocated in layers, with tenured
  316. (long-lived) objects in the older layers. Rather than doing a full GC
  317. of all of memory every time more room is needed, only the last few
  318. layers are GCed during an ephemeral GC, taking much less time.
  319. Short-lived objects are quickly recycled, and full GCs are then much
  320. less frequent. It is most often used to improve the performance of
  321. stop and copy garbage collectors.  It is possible to implement
  322. ephemeral GC in mark and sweep systems, just much more difficult.
  323.  
  324. Stop and copy garbage collection provides simpler storage allocation,
  325. avoids fragmentation of memory (intermixing of free storage with used
  326. storage). Copying, however, consumes more of the address space, since up to
  327. half the space must be kept available for copying all the active objects.
  328. This makes stop and copy GC impractical for systems with a small address
  329. space or without virtual memory.  Also, copying an object requires that you
  330. track down all the pointers to an object and update them to reflect the new
  331. address, while in a non-copying system you need only keep one pointer to an
  332. object, since its location will not change. It is also more difficult to
  333. explicitly return storage to free space in a copying system.
  334.  
  335. Garbage collection is not part of the Common Lisp standard. Most Lisps
  336. provide a function ROOM which provides human-readable information about the
  337. state of storage usage. In many Lisps, (gc) invokes an ephemeral garbage
  338. collection, and (gc t) a full garbage collection.
  339.  
  340. ----------------------------------------------------------------
  341. [2-11] How do I save an executable image of my loaded Lisp system?
  342.        How do I run a Unix command in my Lisp?
  343.        How do I get the current directory name from within a Lisp program?
  344.  
  345. There is no standard for dumping a Lisp image. Here are the
  346. commands from some lisp implementations:
  347.    Lucid:               DISKSAVE
  348.    Symbolics:           Save World  [CP command]
  349.    CMU CL:              SAVE-LISP
  350.    Franz Allegro:       EXCL:DUMPLISP (documented) 
  351.                         SAVE-IMAGE (undocumented)
  352.    Medley:              IL:SYSOUT or IL:MAKESYS
  353.    MCL:                 SAVE-APPLICATION <pathname>
  354.                           &key :toplevel-function  :creator :excise-compiler
  355.                           :size :resources :init-file :clear-clos-caches
  356.    KCL:                 (si:save-system "saved_kcl")
  357.  
  358. There is no standard for running a Unix shell command from Lisp,
  359. especially since not all Lisps run on top of Unix. Here are the
  360. commands from some Lisp implementations:
  361.    Allegro:             EXCL:RUN-SHELL-COMMAND
  362.    Lucid:               RUN-PROGRAM (name 
  363.                                      &key input output
  364.                                           error-output (wait t) arguments
  365.                                           (if-input-does-not-exist :error)
  366.                                           (if-output-exists :error)
  367.                                           (if-error-output-exists :error))
  368.    KCL:                 SYSTEM 
  369.                         For example, (system "ls -l").
  370.                         You can also try RUN-PROCESS and EXCLP, but they
  371.                         don't work with all versions of KCL.
  372.  
  373. There's no standard function for finding the current directory from
  374. within a Lisp program, since not all Lisp environments have the
  375. concept of a current directory. Here are the commands from some Lisp
  376. implementations:
  377.    Lucid:               working-directory (which is also SETFable)
  378.                         pwd and cd also work
  379.    Allegro:             current-directory (use excl:chdir to change it)
  380.    CMU CL:              default-directory
  381.  
  382. Allegro also uses the variable *default-pathname-defaults* to resolve
  383. relative pathnames, maintaining it as the current working directory.
  384. So evaluating (truename "./") in Allegro (and on certain other
  385. systems) will return a pathname for the current directory. Likewise,
  386. in some VMS systems evaluating (truename "[]") will return a pathname
  387. for the current directory.
  388.  
  389. ----------------------------------------------------------------
  390. [2-12] I'm porting some code from a Symbolics Lisp machine to some
  391.        other platform, and there are strange characters in the code.
  392.        What do they mean?
  393.  
  394. The Symbolics Zetalisp character set includes the following
  395. characters not present in other Lisps:
  396.    ^]      >=      greater than or equal to
  397.    ^\      <=      less than or equal to
  398.    ^Z      !=      not equal to
  399.    ^^      ==      equivalent to 
  400.    ^E      not
  401.    ^G      pi
  402.    ^L      +/-     plus/minus
  403.    ^H      lambda
  404.    ^F      epsilon
  405.    ^W      <-->    left/right arrow
  406.    ^X      <--     left arrow
  407.    ^Y      -->     right arrow
  408.  
  409. Other special characters to look out for are the font-change characters,
  410. which are represented as a ^F followed by a digit or asterisk. A digit
  411. means to push font #N onto the stack; an asterisk means to pop the most
  412. recent font from the stack. You can clean up the code by replacing "\^F."
  413. with "".
  414.      
  415. ----------------------------------------------------------------
  416. [2-13] History: Where did Lisp come from?
  417.  
  418. John McCarthy developed the basics behind Lisp during the 1956 Dartmouth
  419. Summer Research Project on Artificial Intelligence.  He intended it as an
  420. algebraic LISt Processing (hence the name) language for artificial
  421. intelligence work. Early implementations included the IBM 704, the IBM
  422. 7090, the DEC PDP-1, the DEC PDP-6 and the DEC PDP-10. The PDP-6 and
  423. PDP-10 had 18-bit addresses and 36-bit words, allowing a CONS cell to
  424. be stored in one word, with single instructions to extract the CAR and
  425. CDR parts. The early PDP machines had a small address space, which
  426. limited the size of Lisp programs. 
  427.  
  428. Milestones in the development of Lisp:
  429.  
  430.    1956            Dartmouth Summer Research Project on AI.
  431.  
  432.    1960-65         Lisp1.5 is the primary dialect of Lisp.
  433.  
  434.    1964-           Development of BBNLisp at BBN.
  435.  
  436.    late 60s        Lisp1.5 diverges into two main dialects:
  437.                    Interlisp (originally BBNLisp) and MacLisp.
  438.  
  439.    early 70s       Development of special-purpose computers known as Lisp
  440.                    Machines, designed specificly to run Lisp programs. 
  441.                    Xerox D-series Lisp Machines run Interlisp-D. 
  442.                    Early MIT Lisp Machines run Lisp Machine Lisp 
  443.                    (an extension of MacLisp).
  444.  
  445.    1969            Anthony Hearn and Martin Griss define Standard Lisp to
  446.                    port REDUCE, a symbolic algebra system, to a variety
  447.                    of architectures.  
  448.  
  449.    late 70s        Macsyma group at MIT developed NIL (New Implementation
  450.                    of Lisp), a Lisp for the VAX.
  451.  
  452.                    Stanford and Lawrence Livermore National Laboratory
  453.                    develop S-1 Lisp for the Mark IIA supercomputer.
  454.  
  455.                    Franz Lisp (dialect of MacLisp) runs on stock-hardware
  456.                    Unix machines.
  457.  
  458.                    Gerald J. Sussman and Guy L. Steele developed Scheme,
  459.                    a simple dialect of Lisp with lexical scoping and
  460.                    lexical closures, continuations as first-class objects,
  461.                    and a simplified syntax (i.e., only one binding per symbol).
  462.  
  463.                    Advent of object-oriented programming concepts in Lisp.
  464.                    Flavors was developed at MIT for the Lisp machine,
  465.                    and LOOPS (Lisp Object Oriented Programming System) was
  466.                    developed at Xerox. 
  467.  
  468.    early 80s       Development of SPICE-Lisp at CMU, a dialect of MacLisp
  469.                    designed to run on the Scientific Personal Integrated
  470.                    Computing Environment (SPICE) workstation.
  471.  
  472.    1980            First biannual ACM Lisp and Functional Programming Conf.
  473.  
  474.    1981            PSL (Portable Standard Lisp) runs on a variety of platforms.
  475.  
  476.    1981+           Lisp Machines from Xerox, LMI (Lisp Machines Inc) 
  477.                    and Symbolics available commercially.
  478.  
  479.    April 1981      Grass roots definition of Common Lisp as a description
  480.                    of the common aspects of the family of languages (Lisp
  481.                    Machine Lisp, MacLisp, NIL, S-1 Lisp, Spice Lisp, Scheme). 
  482.                    
  483.  
  484.    1984            Publication of CLtL1. Common Lisp becomes a de facto 
  485.                    standard.
  486.  
  487.    1986            X3J13 forms to produce a draft for an ANSI Common Lisp
  488.                    standard. 
  489.  
  490.    1987            Lisp Pointers commences publication.
  491.  
  492.    1990            Steele publishes CLtL2 which offers a snapshot of
  493.                    work in progress by X3J13.  (Unlike CLtL1, CLtL2
  494.                    was NOT an output of the standards process and was
  495.                    not intended to become a de facto standard.  Read
  496.                    the Second Edition Preface for further explanation
  497.                    of this important issue.) Includes CLOS,
  498.                    conditions, pretty printing and iteration facilities. 
  499.  
  500.    1992            X3J13 creates a draft proposed American National
  501.                    Standard for Common Lisp. This document is the
  502.                    first official successor to CLtL1. 
  503.  
  504. [Note: This summary is based primarily upon the History section of the
  505. draft ANSI specification. More detail and references can be obtained from
  506. that document. See [1-5] for information on obtaining a copy.]
  507. ----------------------------------------------------------------
  508. [2-14]  How do I find the argument list of a function?
  509.         How do I get the function name from a function object?
  510.  
  511. There is no standard way to find the argument list of a function,
  512. since implementations are not required to save this information.
  513. However, many implementations do remember argument information, and
  514. usually have a function that returns the lambda list. Here are the
  515. commands from some Lisp implementations:
  516.  
  517.    Lucid:                               arglist
  518.    Allegro:                             excl::arglist
  519.    Symbolics:                           arglist
  520.  
  521. CMU Common Lisp, new compiler:
  522.    #+(and :CMU :new-compiler)
  523.    (defun arglist (name)
  524.      (let* ((function (symbol-function name))
  525.             (stype (system:%primitive get-vector-subtype function)))
  526.        (when (eql stype system:%function-entry-subtype)
  527.          (cadr (system:%primitive header-ref function
  528.                                   system:%function-entry-type-slot)))))
  529.  
  530. If you're interested in the number of required arguments you could use
  531.  
  532.    (defun required-arguments (name)
  533.      (or (position-if #'(lambda (x) (member x lambda-list-keywords))
  534.                       (arglist name))
  535.          (length (arglist name))))
  536.  
  537. To extract the function name from the function object, as in
  538.         (function-name #'car) ==> 'car
  539. use the following vendor-dependent functions:
  540.  
  541.    Symbolics: (si::compiled-function-name <fn>)
  542.    Lucid:     (sys::procedure-ref <fn> SYS:PROCEDURE-SYMBOL)
  543.    Allegro:   (Xref::object-to-function-name <fn>)
  544.    CMU CL:    (kernel:%function-header-name <fn>)
  545.    AKCL:      (system::compiled-function-name <fn>)
  546.    MCL:       (ccl::function-name <fn>)
  547.  
  548. ----------------------------------------------------------------
  549. [2-15]  How can I have two Lisp processes communicate via unix sockets?
  550.  
  551. CLX uses Unix sockets to communicate with the X window server. Look at
  552. the following files from the CLX distribution for a good example of
  553. using Unix sockets from Lisp:
  554.         defsystem.lisp          Lucid, AKCL, IBCL, CMU.
  555.         socket.c, sockcl.lisp   AKCL, IBCL
  556.         excldep.lisp            Franz Allegro CL
  557. You will need the "socket.o" files which come with Lucid and Allegro.
  558. To obtain CLX, see the entry for CLX in the answer to question [6-5].
  559.  
  560. See the file lisp-sockets.text in the Lisp Utilities repository
  561. described in the answer to question [6-1].
  562.  
  563. ----------------------------------------------------------------
  564.  
  565. ;;; *EOF*
  566.